package day4;
import java.util.Scanner;
public class D4_4 {
    public static void main(String[] args) {
        Scanner a=new Scanner(System.in);
        System.out.println("请输入您的工资：");
        int salary=a.nextInt();
        double tax=0;
        if (salary<=3000){
            tax=salary*0.03;
        }
        if (salary>3000&&salary<=12000){
            tax=3000*0.03+(salary-3000)*0.1;
        }
        if(salary>12000&&salary<=25000){
            tax=3000*0.03+(12000-3000)*0.1+(salary-25000)*0.2;
        }
        if (salary>25000&&salary<=35000){
            tax=3000*0.03+(12000-3000)*0.1+(25000-12000)*0.2+(salary-25000)*0.25;
        }
        if (salary>35000&&salary<=55000){
            tax=3000*0.03+(12000-3000)*0.1+(25000-12000)*0.2+(35000-25000)*0.25+(salary-35000)*0.3;
        }
        if (salary>55000&&salary<=80000){
            tax=3000*0.03+(12000-3000)*0.1+(25000-12000)*0.2+(35000-25000)*0.25+(55000-35000)*0.3+(salary-55000)*0.35;
        }
        if (salary>80000){
            tax=3000*0.03+(12000-3000)*0.1+(25000-12000)*0.2+(35000-25000)*0.25+(55000-35000)*0.3+(80000-55000)*0.35+(salary-80000)*0.45;
        }
        System.out.println("您需缴纳的个人所得税为："+tax);
        double remain=salary-tax;
        System.out.println("您剩余的余额为："+remain);
    }
}
